using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameMode : MonoBehaviour
{
    public static GameMode Instance;
    public int XLen
    {
        get { return m_XLen; }
    }
    public int YLen
    {
        get { return m_YLen; }
    }
    public int MineCount
    {
        get { return m_MineCount; }
    }
    public EGameMode CurMode
    {
        get { return m_CurMode; }
    }

    public Dictionary<EGameMode, int> PullBackCount
    {
        get { return m_PullBackCount; }
    }


    public void Init(EGameMode gameMode, int xLen, int yLen, int mineCount)
    {
        m_CurMode = gameMode;
        m_XLen = xLen;
        m_YLen = yLen;
        m_MineCount = mineCount;
        m_PullBackCount = new Dictionary<EGameMode, int>();
        m_PullBackCount.Add(EGameMode.Junior, 0);
        m_PullBackCount.Add(EGameMode.Senior, 1);
        m_PullBackCount.Add(EGameMode.Expert, 2);
    }

    public int GetPullBackCount(EGameMode gameMode)
    {
        return m_PullBackCount[gameMode];
    }

    public int GetCurPullBackCount()
    {
        return GetPullBackCount(m_CurMode);
    }


    //=========================================公私分界线==================================================

    private int m_XLen;
    private int m_YLen;
    private int m_MineCount;
    private EGameMode m_CurMode;
    private Dictionary<EGameMode, int> m_PullBackCount;

    void Awake()
    {
        DontDestroyOnLoad(gameObject);
        Instance = this;
    }

}

public enum EGameMode
{
    Junior = 0,
    Senior = 1,
    Expert = 2,
    Customer = 3,
}
